<template>
  <view>
    <uni-popup ref="popModel" type="center"
               :maskClick="false"
               border-radius="10px 10px 0 0">
      <view class="pop-box">
        <view class="title">转换为租赁宝</view>
        <view class="content">
          <view class="item">
            <view class="l">蚂蚁链结算方式</view>
            <radio-group>
              <label v-for="(item,index) in radioList" :key="index" class="uni-list-cell uni-list-cell-pd mr-20">
                <radio @change="radioChange(item.value)" :value="item.value" :checked="item.value === eform.biz_scene"/>
                {{ item.label }}
              </label>
            </radio-group>
          </view>
        </view>
        <view class="footer">
          <view class="btn cancel" @click="close">取消</view>
          <view class="btn confirm" @click="save">确定</view>
        </view>
      </view>
    </uni-popup>
  </view>
</template>

<script>
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
import {editAddress} from "@/api/admin"
import {changeCheckType, setPrice, verifyOrder} from "../../../api/admin";
export default {
  components: {UniPopup},
  props:['nowItem'],
  data() {
    return {
      radioList:[
        {
          label:'分期结算',
          value:1
        },
        {
          label:'整单结算',
          value:2
        }
      ],
      eform: { biz_scene: 1, check_type: 2 }, // 合同类型
    }
  },
  mounted(){
    this.$refs.popModel.open()
  },
  methods: {
    close(){
      this.$emit('close','editContractShow')
    },
    save(){
      changeCheckType(this.nowItem.id,this.eform).then(res=>{
        // 提示成功
        this.$util.Tips({ title: '保存成功'})
        this.$emit('refresh')
        this.close()
      })
    },
    radioChange(e){
      this.eform.biz_scene=e
    }
  },
}
</script>

<style lang="scss" scoped>
.pop-box{
  width: 90vw;
  max-height: 66vh;
  padding: 30rpx;
  border-radius: 28rpx;
  background: #fff;
  .title{
    font-size: 30rpx;
    margin-bottom: 30rpx;
    font-weight: bold;
  }
  .content{
    .item{
      display: flex;
      align-items: center;
      margin-bottom: 30rpx;
      .l{
        white-space: nowrap;
        flex: 0 0 220rpx;
      }
      .r{
        flex:1;
        padding-right: 30rpx;
      }
    }
  }
  .footer{
    display: flex;
    justify-content: center;
    margin-top: 30rpx;
    .btn{
      padding: 0 50rpx;
      line-height: 60rpx;
      border-radius: 28rpx;
    }
    .cancel{
      color: #333;
      border: 1rpx solid #CCCCCC;
      margin-right: 30rpx;
    }
    .confirm{
      color: #fff;
      background: #1497fa;
    }
  }
}
textarea{
  font-size: 28rpx;
  border: 1rpx solid #ddd;
  width: 100%;
  margin-top: 20rpx;
  margin-bottom: 20rpx;
  box-sizing: border-box;
}
</style>